var fStockID = $("#fStockID").val();
var fSPID = $("#fSPID").val();
var fSPName = $("#fSPName").val();
var fStockName = $("#fStockName").val();
console.log(fStockName);
/*
 * @Description: 预加载
 * @param : 
 */
$(function (){
	$("#heading").qrcode({
		width: 110,
		height: 110,
		correctLevel : 3,
		text: '[{"fStockID":"'+fStockID+'","fSPID":"'+fSPID+'","fStockName":"'+toUtf8(fStockName)+'","fSPName":"'+fSPName+'"}]'
	});
	setTimeout(function(){
		print();
	}, 500);
});

/*
 * @Description: 打印
 * @param :
 */
function print() {
	var canvas=document.getElementsByTagName("canvas")[0];
	var dataURL = canvas.toDataURL("image/png");
	var img = '<img src="'+dataURL+'"></img>';
	$("#heading").html(img);
	$(".row").print({
		deferred: $.Deferred().done(function() { 
			window.close(); 
		})//打印完后自动关闭打印页面
	});
}